package org.ladybug.service.impl;

import java.util.Date;

import org.apache.commons.lang.RandomStringUtils;
import org.ladybug.web.controller.model.ModelUtente;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;

public class UserCommandServiceTest extends
		AbstractDependencyInjectionSpringContextTests {

	private UserCommandService userCommandService;

	public void testInsertOrUpdate() throws Exception {
		ModelUtente uc = new ModelUtente();
		uc.setNickname(RandomStringUtils.randomAlphabetic(8));
		uc.setPassword("fff");
		uc.setCognome("ee");
		uc.setDataNascita(new Date());
		uc.setEmail("ddddd");
		uc.setNome("aa");
		uc.setAdministrator(true);
		userCommandService.insertOrUpdate(uc, null);
	}

	
	
	protected String[] getConfigLocations() {
		return new String[] { "file:c:/sviluppo/ladybug/src/web/ladybug/WEB-INF/application-beans.xml","file:c:/sviluppo/ladybug/src/web/ladybug/WEB-INF/security-beans.xml" };
	}



	public UserCommandService getUserCommandService() {
		return userCommandService;
	}



	public void setUserCommandService(UserCommandService userCommandService) {
		this.userCommandService = userCommandService;
	}
}
